//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Fri Dec  5 11:53:50 2014 by ROOT version 5.34/14
// from TTree truth/2
// found on file: ../AnaOut_allD3_994files.root
//////////////////////////////////////////////////////////

#ifndef truth_h
#define truth_h

#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>

// Header file for the classes stored in the TTree if any.

// Fixed size dimensions of array or collections stored in the TTree if any.

class truth {
public :
   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
   Int_t           fCurrent; //!current Tree number in a TChain

   // Declaration of leaf types
   Int_t           accum_level;
   Int_t           reaction;
   Int_t           reactionnofv;
   Int_t           topology;
   Int_t           topology2;
   Int_t           mectopology;
   Int_t           particle;
   Int_t           detector;
   Int_t           nutype;
   Int_t           evt;
   Int_t           run;
   Int_t           subrun;
   Int_t           TruthVertexID;
   Int_t           RooVtxIndex;
   Int_t           RooVtxEntry;
   Int_t           nu_pdg;
   Float_t         nu_trueE;
   Int_t           nu_truereac;
   Float_t         nu_truedir[3];
   Float_t         nu_vertex_truepos[4];
   Int_t           NWEIGHTS;
   Float_t         weight[2];   //[NWEIGHTS]
   Float_t         truemu_truemom;
   Float_t         truemu_truecostheta;
   Float_t         truemu_truepos[4];
   Float_t         truemu_truedir[3];

   // List of branches
   TBranch        *b_accum_level;   //!
   TBranch        *b_reaction;   //!
   TBranch        *b_reactionnofv;   //!
   TBranch        *b_topology;   //!
   TBranch        *b_topology2;   //!
   TBranch        *b_mectopology;   //!
   TBranch        *b_particle;   //!
   TBranch        *b_detector;   //!
   TBranch        *b_nutype;   //!
   TBranch        *b_evt;   //!
   TBranch        *b_run;   //!
   TBranch        *b_subrun;   //!
   TBranch        *b_TruthVertexID;   //!
   TBranch        *b_RooVtxIndex;   //!
   TBranch        *b_RooVtxEntry;   //!
   TBranch        *b_nu_pdg;   //!
   TBranch        *b_nu_trueE;   //!
   TBranch        *b_nu_truereac;   //!
   TBranch        *b_nu_truedir;   //!
   TBranch        *b_nu_vertex_truepos;   //!
   TBranch        *b_NWEIGHTS;   //!
   TBranch        *b_weight;   //!
   TBranch        *b_truemu_truemom;   //!
   TBranch        *b_truemu_truecostheta;   //!
   TBranch        *b_truemu_truepos;   //!
   TBranch        *b_truemu_truedir;   //!

   truth(TTree *tree=0);
   virtual ~truth();
   virtual Int_t    Cut(Long64_t entry);
   virtual Int_t    GetEntry(Long64_t entry);
   virtual Long64_t LoadTree(Long64_t entry);
   virtual void     Init(TTree *tree);
   virtual void     Loop();
   virtual Bool_t   Notify();
   virtual void     Show(Long64_t entry = -1);
};

#endif

#ifdef truth_cxx
truth::truth(TTree *tree) : fChain(0) 
{
// if parameter tree is not specified (or zero), connect the file
// used to generate this class and read the Tree.
   if (tree == 0) {
      TFile *f = (TFile*)gROOT->GetListOfFiles()->FindObject("../AnaOut_allD3_994files.root");
      if (!f || !f->IsOpen()) {
         f = new TFile("../AnaOut_allD3_994files.root");
      }
      f->GetObject("truth",tree);

   }
   Init(tree);
}

truth::~truth()
{
   if (!fChain) return;
   delete fChain->GetCurrentFile();
}

Int_t truth::GetEntry(Long64_t entry)
{
// Read contents of entry.
   if (!fChain) return 0;
   return fChain->GetEntry(entry);
}
Long64_t truth::LoadTree(Long64_t entry)
{
// Set the environment to read one entry
   if (!fChain) return -5;
   Long64_t centry = fChain->LoadTree(entry);
   if (centry < 0) return centry;
   if (fChain->GetTreeNumber() != fCurrent) {
      fCurrent = fChain->GetTreeNumber();
      Notify();
   }
   return centry;
}

void truth::Init(TTree *tree)
{
   // The Init() function is called when the selector needs to initialize
   // a new tree or chain. Typically here the branch addresses and branch
   // pointers of the tree will be set.
   // It is normally not necessary to make changes to the generated
   // code, but the routine can be extended by the user if needed.
   // Init() will be called many times when running on PROOF
   // (once per file to be processed).

   // Set branch addresses and branch pointers
   if (!tree) return;
   fChain = tree;
   fCurrent = -1;
   fChain->SetMakeClass(1);

   fChain->SetBranchAddress("accum_level", &accum_level, &b_accum_level);
   fChain->SetBranchAddress("reaction", &reaction, &b_reaction);
   fChain->SetBranchAddress("reactionnofv", &reactionnofv, &b_reactionnofv);
   fChain->SetBranchAddress("topology", &topology, &b_topology);
   fChain->SetBranchAddress("topology2", &topology2, &b_topology2);
   fChain->SetBranchAddress("mectopology", &mectopology, &b_mectopology);
   fChain->SetBranchAddress("particle", &particle, &b_particle);
   fChain->SetBranchAddress("detector", &detector, &b_detector);
   fChain->SetBranchAddress("nutype", &nutype, &b_nutype);
   fChain->SetBranchAddress("evt", &evt, &b_evt);
   fChain->SetBranchAddress("run", &run, &b_run);
   fChain->SetBranchAddress("subrun", &subrun, &b_subrun);
   fChain->SetBranchAddress("TruthVertexID", &TruthVertexID, &b_TruthVertexID);
   fChain->SetBranchAddress("RooVtxIndex", &RooVtxIndex, &b_RooVtxIndex);
   fChain->SetBranchAddress("RooVtxEntry", &RooVtxEntry, &b_RooVtxEntry);
   fChain->SetBranchAddress("nu_pdg", &nu_pdg, &b_nu_pdg);
   fChain->SetBranchAddress("nu_trueE", &nu_trueE, &b_nu_trueE);
   fChain->SetBranchAddress("nu_truereac", &nu_truereac, &b_nu_truereac);
   fChain->SetBranchAddress("nu_truedir", nu_truedir, &b_nu_truedir);
   fChain->SetBranchAddress("nu_vertex_truepos", nu_vertex_truepos, &b_nu_vertex_truepos);
   fChain->SetBranchAddress("NWEIGHTS", &NWEIGHTS, &b_NWEIGHTS);
   fChain->SetBranchAddress("weight", weight, &b_weight);
   fChain->SetBranchAddress("truemu_truemom", &truemu_truemom, &b_truemu_truemom);
   fChain->SetBranchAddress("truemu_truecostheta", &truemu_truecostheta, &b_truemu_truecostheta);
   fChain->SetBranchAddress("truemu_truepos", truemu_truepos, &b_truemu_truepos);
   fChain->SetBranchAddress("truemu_truedir", truemu_truedir, &b_truemu_truedir);
   Notify();
}

Bool_t truth::Notify()
{
   // The Notify() function is called when a new file is opened. This
   // can be either for a new TTree in a TChain or when when a new TTree
   // is started when using PROOF. It is normally not necessary to make changes
   // to the generated code, but the routine can be extended by the
   // user if needed. The return value is currently not used.

   return kTRUE;
}

void truth::Show(Long64_t entry)
{
// Print contents of entry.
// If entry is not specified, print current entry
   if (!fChain) return;
   fChain->Show(entry);
}
Int_t truth::Cut(Long64_t entry)
{
// This function may be called from Loop.
// returns  1 if entry is accepted.
// returns -1 otherwise.
   return 1;
}
#endif // #ifdef truth_cxx
